3.2455 \(\int \frac{\left (a+b x^n\right )^2}{x} \, dx\)

Optimal. Leaf size=32 \[ a^2 \log (x)+\frac{2 a b x^n}{n}+\frac{b^2 x^{2 n}}{2 n} \]

[Out]

(2*a*b*x^n)/n + (b^2*x^(2*n))/(2*n) + a^2*Log[x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0434729, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154 \[ a^2 \log (x)+\frac{2 a b x^n}{n}+\frac{b^2 x^{2 n}}{2 n} \]

Antiderivative was successfully verified.

[In]  Int[(a + b*x^n)^2/x,x]

[Out]

(2*a*b*x^n)/n + (b^2*x^(2*n))/(2*n) + a^2*Log[x]

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \frac{a^{2} \log{\left (x^{n} \right )}}{n} + \frac{2 a b x^{n}}{n} + \frac{b^{2} \int ^{x^{n}} x\, dx}{n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((a+b*x**n)**2/x,x)

[Out]

a**2*log(x**n)/n + 2*a*b*x**n/n + b**2*Integral(x, (x, x**n))/n

_______________________________________________________________________________________

Mathematica [A]  time = 0.0277067, size = 27, normalized size = 0.84 \[ a^2 \log (x)+\frac{b x^n \left (4 a+b x^n\right )}{2 n} \]

Antiderivative was successfully verified.

[In]  Integrate[(a + b*x^n)^2/x,x]

[Out]

(b*x^n*(4*a + b*x^n))/(2*n) + a^2*Log[x]

_______________________________________________________________________________________

Maple [A]  time = 0.003, size = 36, normalized size = 1.1 \[{\frac{ \left ({x}^{n} \right ) ^{2}{b}^{2}}{2\,n}}+2\,{\frac{ab{x}^{n}}{n}}+{\frac{{a}^{2}\ln \left ({x}^{n} \right ) }{n}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((a+b*x^n)^2/x,x)

[Out]

1/2/n*(x^n)^2*b^2+2*a*b*x^n/n+1/n*a^2*ln(x^n)

_______________________________________________________________________________________

Maxima [A]  time = 1.44274, size = 46, normalized size = 1.44 \[ \frac{a^{2} \log \left (x^{n}\right )}{n} + \frac{b^{2} x^{2 \, n} + 4 \, a b x^{n}}{2 \, n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x^n + a)^2/x,x, algorithm="maxima")

[Out]

a^2*log(x^n)/n + 1/2*(b^2*x^(2*n) + 4*a*b*x^n)/n

_______________________________________________________________________________________

Fricas [A]  time = 0.238836, size = 41, normalized size = 1.28 \[ \frac{2 \, a^{2} n \log \left (x\right ) + b^{2} x^{2 \, n} + 4 \, a b x^{n}}{2 \, n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x^n + a)^2/x,x, algorithm="fricas")

[Out]

1/2*(2*a^2*n*log(x) + b^2*x^(2*n) + 4*a*b*x^n)/n

_______________________________________________________________________________________

Sympy [A]  time = 0.71041, size = 36, normalized size = 1.12 \[ \begin{cases} a^{2} \log{\left (x \right )} + \frac{2 a b x^{n}}{n} + \frac{b^{2} x^{2 n}}{2 n} & \text{for}\: n \neq 0 \\\left (a + b\right )^{2} \log{\left (x \right )} & \text{otherwise} \end{cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a+b*x**n)**2/x,x)

[Out]

Piecewise((a**2*log(x) + 2*a*b*x**n/n + b**2*x**(2*n)/(2*n), Ne(n, 0)), ((a + b)
**2*log(x), True))

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (b x^{n} + a\right )}^{2}}{x}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x^n + a)^2/x,x, algorithm="giac")

[Out]

integrate((b*x^n + a)^2/x, x)